package dao;

import java.sql.SQLException;
import java.util.ArrayList;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

import vo.MemberVO;
import vo.OrderListByOrderIdVO;
import vo.OrderListVO;
import vo.OrderVO;

public class OrderDAO {
	
	private SqlMapClientTemplate client;

	public void setSqlMapClientTemplate(SqlMapClientTemplate client) {this.client = client;}
	
	public MemberVO selectMemberById(String member_id) throws SQLException{
		return (MemberVO)client.queryForObject("selectMemberById", member_id);
	}

	public void insertOrderList(OrderListVO orderLisvVO) throws SQLException{
		client.insert("insertOrderList", orderLisvVO);
	}

	public ArrayList<OrderListVO> selectOrderListByOrderId(String orderId) throws SQLException{
		return (ArrayList<OrderListVO>) client.queryForList("selectOrderListByOrderId", orderId);
	}
	
	public void insertOrderVO(OrderVO orderVO) throws SQLException{
		client.insert("insertOrderVO", orderVO);
	}
	
	public ArrayList<OrderListByOrderIdVO> selectOrderByMemberId(String member_id) throws SQLException{
		return (ArrayList<OrderListByOrderIdVO>)client.queryForList("selectOrderByMemberId", member_id);
	}
	
	public ArrayList<OrderVO> selectOrderListByMemberId(String member_id) throws SQLException{
		return (ArrayList<OrderVO>)client.queryForList("selectOrderListByMemberId", member_id);
	}
	
	public ArrayList<String> selectOrderDayByMemberId(String member_id) throws SQLException{
		return (ArrayList<String>) client.queryForList("selectOrderDayByMemberId", member_id);
	}

}